package com.archive.forum.exception;
//自定义异常类
public class CustomizeException extends RuntimeException{
    private String errorMsg;
    private String errorCode;
    public CustomizeException(){
        super();
    }

    public CustomizeException(BaseErrorInfoInterface errorCode){
        super(errorCode.getResultCode());
        this.errorMsg = errorCode.getResultMsg();
        this.errorCode = errorCode.getResultCode();
    }
    public CustomizeException(BaseErrorInfoInterface errorCode, Throwable cause){
        super(errorCode.getResultCode(),cause);
        this.errorMsg = errorCode.getResultMsg();
        this.errorCode = errorCode.getResultCode();
    }
    public CustomizeException(String message){
        super(message);
        this.errorMsg = message;
    }

    public CustomizeException(String message, String code){
        super(code);
        this.errorMsg = message;
        this.errorCode = code;
    }
    public CustomizeException(String code,String message,Throwable cause){
        super(code,cause);
        this.errorCode = code;
        this.errorMsg = message;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}
